<?php
###
#  Baing PHP 框架 1.0.0
#  http://baing.co/
#
#  Copyright: 白晓阳
#  License: CC BY-NC-SA 4.0
#  https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh
###

namespace bai\resource\document;


class Cache extends \bai\resource\document\Php
{
    protected static function checkPath(string $path, bool $autoload = false): bool
    {
        if (parent::checkPath($path, $autoload)) return true;

        $root = self::config(['path', 'document', self::className()]);
        if (!str_contains($path, $root)) {
            $path = "$root/$path";
        }
        return is_file($path);
    }
}
